/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.testis.gui.mvc.model.testbed;

import org.testis.gui.mvc.model.AbstractModel;
import org.testis.gui.mvc.controller.testbed.DeviceFirmwareController;
import org.testis.orm.testbed.refined.DeviceFirmwareRefined;

/**
 *
 * @author selcuk
 */
public class DeviceFirmwareModel extends AbstractModel {

    private DeviceFirmwareRefined m_FirmwareRefined = null;
    private Integer m_firmwareId = 0;
    private String m_name = "";
    private String m_description = "";
    private Integer m_deviceId = 0;
    private Integer m_deviceMapId = 0;
    private String m_lastError = "";
    private Boolean m_visibility = false;

    public void setVisibility(Boolean val) {
        if (val == null) {
            return;
        }
        Boolean oldVal = m_visibility;
        m_visibility = val;
        firePropertyChange(DeviceFirmwareController.VISIBLE_PROPERTY,
                oldVal,
                val);
    }

    public Boolean getVisibility() {
        return m_visibility;
    }

    public String getName() {
        return m_name;
    }

    public void setName(String name) {
        if (name == null) {
            name = "";
        }
        String oldName = m_name;
        m_name = name;
        firePropertyChange(DeviceFirmwareController.NAME_PROPERTY,
                oldName,
                name);
    }

    public String getLastError() {
        return m_lastError;
    }

    public void setLastError(String val) {
        if (val == null) {
            val = "";
        }
        String oldValue = m_lastError;
        m_lastError = val;
        firePropertyChange(DeviceFirmwareController.ERROR_PROPERTY, null,
                m_lastError);
    }

    /**
     * @return the m_deviceId
     */
    public Integer getDeviceId() {
        return m_deviceId;
    }

    /**
     * @param val the m_deviceId to set
     */
    public void setDeviceId(Integer val) {
        if (val == null) {
            return;
        }
        Integer oldVal = m_deviceId;
        this.m_deviceId = val;
        firePropertyChange(DeviceFirmwareController.DEVICE_ID_PROPERTY,
                oldVal,
                val);
    }

    /**
     * @return the m_deviceMapId
     */
    public Integer getDeviceMapId() {
        return m_deviceMapId;
    }

    /**
     * @param val the m_deviceMapId to set
     */
    public void setDeviceMapId(Integer val) {
        if (val == null) {
            return;
        }
        Integer oldVal = m_deviceMapId;
        this.m_deviceMapId = val;
        firePropertyChange(DeviceFirmwareController.MAP_ID_PROPERTY,
                oldVal,
                val);
    }

    /**
     * @return the m_description
     */
    public String getDescription() {
        return m_description;
    }

    /**
     * @param val the m_description to set
     */
    public void setDescription(String val) {
        if (val == null) {
            val = "";
        }
        String oldName = m_name;
        this.m_description = val;
        firePropertyChange(DeviceFirmwareController.DESCRIPTION_PROPERTY,
                oldName,
                val);
    }

    /**
     * @return the m_firmwareId
     */
    public Integer getFirmwareId() {
        return m_firmwareId;
    }

    /**
     * @param val the m_firmwareId to set
     */
    public void setFirmwareId(Integer val) {
        if (val == null) {
            return;
        }
        Integer oldVal = m_firmwareId;
        this.m_firmwareId = val;
        firePropertyChange(DeviceFirmwareController.FIRMWARE_ID_PROPERTY,
                oldVal,
                val);
    }

    /**
     * @return the m_FirmwareRefined
     */
    public DeviceFirmwareRefined getFirmwareRefined() {
        return m_FirmwareRefined;
    }

    /**
     * @param val the m_FirmwareRefined to set
     */
    public void setFirmwareRefined(DeviceFirmwareRefined val) {
        if (val == null) {
            return;
        }
        DeviceFirmwareRefined oldVal = m_FirmwareRefined;
        this.m_FirmwareRefined = val;
        firePropertyChange(DeviceFirmwareController.FIRMWARE_REFINED_PROPERTY,
                oldVal,
                val);
    }
}
